package com.hdu.guahao.controller;

import com.hdu.guahao.common.result.Result;
import com.hdu.guahao.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/api/order/orderInfo")
@RestController
public class OrderAPIController {

    @Autowired
    private OrderService orderService;


    @GetMapping("auth/submitOrder/{scheduleId}/{patientId}")
    public Result saveOrder(@PathVariable String scheduleId,
                            @PathVariable Long patientId){
            Long orderId = orderService.saveOrder(scheduleId,patientId);
            return Result.ok(orderId);
    }
}
